<?php
namespace app\web\model;

use cubox\Model as biModel;

class Model extends biModel{
    public function getType($name = ''){
        $typeArr = [
            'part'=>'栏目',
            'article' => '文章',
            'block' => '区块',
            'page' => '页面'
        ];

        if ($name){
            return $typeArr[$name];
        }else{
            return $typeArr;
        }
    }

    //保留字段名
    public function reservedField($type){
        $fieldList = [];
        $fieldList['part'] = ['title','route','path','row'];
        $fieldList['article'] = ['title','route','path','row','content','title_style','create_date','update_date'];
        $fieldList['block'] = [];
        $fieldList['page'] = ['title','route','path','row'];
 
        return $fieldList[$type]??[];
    }
}